	
function createForm()
{
			
	Ext.create('Ext.form.Panel', 
	{
		renderTo : 'addSourceForm',  
		title : 'Add a new source ', 
		url : '/../Cafca/EventServlet', 
		method : 'POST', 
		frame : true, 
		height : 300, 
		width : 400, 
		items : [
	         {
	        	 xtype:'textfield',
	        	 fieldLabel : 'Source name',
	        	 name : 'sourceId', 
	        	 allowBlank : false
	         },
	         {
	        	 xtype : 'datefield',
	        	 fieldLabel : 'Date', 
	        	 format : 'd/m/Y',  
	        	 name : 'startDate', 
	        	 allowBlank : false, 
	        	 value: new Date()
	         },
	         {
	        	 xtype : 'timefield',
	        	 fieldLabel : 'Time', 
	        	 name : 'startTime', 
	        	 allowBlank : false, 
	        	 format:'H:i',
	        	 value:'00:00'
	         },
	         {
	        	xtype:'textfield',
	        	fieldLabel:'Tags',
	        	name:'tags',
	        	allowBlank:true,
	        	value:'NEW_SOURCE'
	         },
	         {
	        	 xtype : 'button', 
	        	 text : 'Create ', 
	        	 disabled : true, 
	 			 formBind : true,
	 			 handler : function(){
	 				var dataToSend = this.up('form').getForm(); 
					dataToSend.submit(
						{
						    params: 
						    {
						    	eventType:'SourceManagementEvent',
						    	mode:'create'
						    },
							success:function(form, action)
							{
							
							}, 
							
							failure:function(form, action)
							{
							
							}
						}
					);
	         }
	         
	         }]
	});
}

Ext.onReady(createForm); 